<%@ page language="java" import="java.util.*,java.text.*" pageEncoding="utf-8"%>
<%@page import="issuedfileaction.DBConnection;"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>       
    <title>登陆数据收取</title>    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>  
  <body> 
  <%
      DBConnection db=new DBConnection();
  	  SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
      String BeginTime="2012-07-06";//sdf.format(new Date());
      String EndTime="2012-07-07";//sdf.format(new Date());
      String CustomerName="";
      String StandMan="";
      String TransType="";
      String Province="";
      String FlowState="";
      String TransPurChase="NA";
      String TransSale="NA";
      String TransStock="NA";
      String rolldays=db.SQLExec("select optionvalue from orgoption where optionname='ROOLBACK_DATADAY' ");
      //采购行，数量      
      db.SQLUpdateLinesAndQty("call sysdatacontrastsourcedatapur(?,?,?)",BeginTime,EndTime,"PD");
      //销售行，数量
      db.SQLUpdateLinesAndQty("call sysdatacontrastsourcedatasales(?,?,?)",BeginTime,EndTime,"SD");
      //库存行，数量
      db.SQLUpdateLinesAndQty("call sysdatacontrastsourcedatastock(?,?,?)",BeginTime,EndTime,"ID");
      //文件状态
      db.SQLUpdateDayState("call getdatastate(?,?,?)",BeginTime,EndTime,rolldays);
            
      List<Object> ListRows=new ArrayList<Object>();      
      ListRows=db.SQLProListExec("{call DAYCONSOLE.PRO_DAYREAD(?,?,?,?,?,?,?,?,?,?,?,?,?)}",BeginTime,EndTime,CustomerName,StandMan,TransType,Province,TransPurChase,TransSale,TransStock);
      HttpSession httpSession = request.getSession();
      httpSession.setAttribute("ListRows", ListRows);	
      httpSession.setAttribute("BeginTime",BeginTime);
      httpSession.setAttribute("EndTime",EndTime);
      httpSession.setAttribute("CustomerName",CustomerName);
      httpSession.setAttribute("StandMan",StandMan);
      httpSession.setAttribute("TransType",TransType);
      httpSession.setAttribute("Province",Province);
      httpSession.setAttribute("FlowState",FlowState);                		    	  
	  response.sendRedirect("monitor.jsp");      
  %>
  </body>
</html>